#include "funcionesSueltas.h"
#include <stdlib.h>
/*
FILE* abrirApariciones(string palabra, string modo){
	string fileName;
	fileName = "apariciones_de_";
	fileName += palabra;
	fileName += ".txt";
	FILE* file = fopen(fileName.c_str(), modo.c_str());
	return file;
}

int obtenerAparicion(FILE * file){
	char stringNumeroFragmento[];
	fgets(stringNumeroFragmento, 10, file);
	return atoi(stringNumeroFragmento);
}
*/

void split(string unString, char separador, vector<string>* destino){
	size_t posInicial = 0;
	size_t posFinal = unString.find(separador, posInicial);
	while((unString.size() > posFinal) and (posFinal >= 0)){
		if(posFinal > posInicial)
			destino->push_back(unString.substr(posInicial, posFinal - posInicial));
		posInicial = posFinal + 1;
		posFinal = unString.find(separador, posInicial);
	}
	destino->push_back(unString.substr(posInicial, unString.size()));

}


